import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './styles/index.less'
import Vant, { Lazyload } from 'vant'
import 'vant/lib/index.css'

import 'amfe-flexible'
// import axios from 'axios'
// Vue.prototype.axios = axios
// axios.defaults.baseURL = 'http://api-toutiao-web.itheima.net/app'

import dayjs from 'dayjs'

// 加载中文语言包
import 'dayjs/locale/zh-cn'

import relativeTime from 'dayjs/plugin/relativeTime'

// 配置使用处理相对时间的插件
dayjs.extend(relativeTime)

// 配置使用中文语言包
dayjs.locale('zh-cn')

Vue.filter('relativeTime', (value) => {
  return dayjs().to(dayjs(value))
})

Vue.use(Vant)
Vue.use(Lazyload)
Vue.config.productionTip = false

new Vue({
  router,
  store,

  render: (h) => h(App)
}).$mount('#app')
